import React from 'react';
import {Link} from 'react-router';
import {Menu, Icon} from 'antd';

const SubMenu = Menu.SubMenu;

let activeKeys = ["2"]
if(location.href.includes('person')) {
	activeKeys = ["1"]
}

export default({children}) => {

	return (
		<div>
			<div style={{paddingLeft: 30, background: '#001529', height: 48, lineHeight: '48px', color: '#fff', fontSize: 16, fontWeight: 'bold'}}>病理数据统计</div>
			<div style={{display: 'flex'}}>
				<div style={{width: 200, paddingTop: 5, height: 'calc(100vh - 55px)'}}>
					<Menu
						mode="inline"
						defaultSelectedKeys={activeKeys}
						defaultOpenKeys={['sub1']}
						style={{ width: 200, height: 'calc(100vh - 70px)' }}
					>
						<SubMenu key="sub1" title={<span><Icon type="bars" /><span>数据汇总</span></span>}>
							<Menu.Item key="1"><Link to="/person">病理数据</Link></Menu.Item>
							<Menu.Item key="2"><Link to="/home">统计数据</Link></Menu.Item>
						</SubMenu>
					</Menu>
				</div>
				<div style={{flex: 1, height: 'calc(100vh - 55px)', overflow: 'auto'}}>{children}</div>
			</div>
		</div>
	)
}